<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	
	<head>
		<title>My JSP 'personalInfor.jsp' starting page</title>
		<s:head theme="ajax" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="../css/register.css">
		<link rel="stylesheet" type="text/css" href="../css/content.css">
		<script type="text/javascript" src="../js/common.js"></script>
		<script type="text/javascript" src="../js/personal.js"></script>
	</head>

	<body onload="initEvent()">
		<div id="personal_container">
			<s:if test='userType=="0"'>
				<table class="personalInfor">
					<tr>
						<td colspan="2" style="text-align: right;">
							<span class="modify_1"> <a href="javascript:void(0)"
								onclick="modifyPassword()">修改密码</a> </span>
							<span class="modify_2"> <a href="javascript:void(0)"
								onclick="modifyInfo('0')"> 修改个人信息</a> </span>
						</td>
					</tr>
					<tr>
						<td class="personal_1">
							学号
						</td>
						<td class="personal_2">
							${user.studentNum }
						</td>
					</tr>
					<tr>
						<td>
							姓名
						</td>
						<td>
							${user.name }
						</td>
					</tr>
					<tr>
						<td>
							专业
						</td>
						<td>
							${user.professional.professionalName }
						</td>
					</tr>
					<tr>
						<td>
							年纪
						</td>
						<td>
							${user.grade }
						</td>
					</tr>
					<tr>
						<td>
							班级
						</td>
						<td>
							${user.classes }
						</td>
					</tr>
					<tr>
						<td>
							手机
						</td>
						<td>
							${user.telephone }
						</td>
					</tr>
					<tr>
						<td>
							邮箱
						</td>
						<td>
							${user.email }
						</td>
					</tr>
					<tr>
						<td>
							固定电话
						</td>
						<td>
							${user.fixedTelephone }
						</td>
					</tr>
				</table>
			</s:if>
			<s:elseif test='userType=="1"'>
				<table class="personalInfor">
					<tr>
						<td colspan="2" style="text-align: right;">
							<span class="modify_1"> <a href="javascript:void(0)"
								onclick="modifyPassword()">修改密码</a> </span>
							<span class="modify_2"> <a href="javascript:void(0)"
								onclick="modifyInfo('1')">修改个人信息</a> </span>
						</td>
					</tr>
					<tr>
						<td class="personal_1">
							教工号
						</td>
						<td class="personal_2">
							${user.teacherNum }
						</td>
					</tr>
					<tr>
						<td>
							姓名
						</td>
						<td>
							${user.name }
						</td>
					</tr>
					<tr>
						<td>
							研究所
						</td>
						<td>
							${user.institute.instituteName }
						</td>
					</tr>
					<tr>
						<td>
							职称
						</td>
						<td>
							${user.teachersTitles }
						</td>
					</tr>
					<tr>
						<td>
							研究方向
						</td>
						<td>
							${user.research }
						</td>
					</tr>
					<tr>
						<td>
							手机
						</td>
						<td>
							${user.telephone }
						</td>
					</tr>
					<tr>
						<td>
							邮箱
						</td>
						<td>
							${user.email }
						</td>
					</tr>
					<tr>
						<td>
							固定电话
						</td>
						<td>
							${user.fixedTelephone }
						</td>
					</tr>
				</table>
			</s:elseif>
		</div>

		<div id="password_container" class="container" style="display: none;">
			<div class="c_head">
				<span class="c_head_1" id="personal_head">修改密码</span>
				<span class="c_head_2"> <a href="javascript:void(0)"> <IMG
							src="../img/close2.gif"
							onclick="closePassword('password_container')"> </a> </span>
			</div>
			<div id="password_content">
				<div>
					<s:url id="modifyP" action="otherSet/modifyPassword.action"></s:url>
					<s:form cssClass="userForm" id="passwordForm" name="passwordForm"
						onsubmit="return checkPassword()">
						<s:password id="password" cssClass="userField" label="原密码"
							name="password"></s:password>
						<s:password id="newPassword" cssClass="userField" label="新密码"
							name="newPassword"></s:password>
						<s:password id="reNewPassword" cssClass="userField" label="重复新密码"
							name="reNewPassword"></s:password>
					</s:form>
				</div>
				<div>
					<s:a href="%{modifyP}" cssClass="userSubmit" theme="ajax"
						formId="passwordForm" targets="passwordTip" loadingText="修改中...">修改</s:a>
				</div>
				<div id="passwordTip" class="tip">
				</div>
			</div>
		</div>


		<div id="infor_container" class="container" style="display: none;">
			<div class="c_head">
				<span class="c_head_1" id="personal_head">修改密码</span>
				<span class="c_head_2"> <a href="javascript:void(0)"> <IMG
							src="../img/close2.gif"
							onclick="closePassword('infor_container')"> </a> </span>
			</div>
			<div id="infor_content">
				<div>
					<s:url id="modifyI" action="otherSet/modifyInfor.action"></s:url>
					<s:form cssClass="userForm" id="inforForm" onsubmit="return checkUser('%{userType}')" name="informForm">
						<s:if test='userType=="0"'>
							<s:textfield label="手机" cssClass="userField"
								name="student.telephone" id="sTelephone" value="%{user.telephone}"></s:textfield>
							<s:textfield label="邮箱" cssClass="userField" name="student.email"
								id="sEmail" value="%{user.email}"></s:textfield>
							<s:textfield label="固定电话" cssClass="userField"
								name="student.fixedTelephone" id="sFixed"
								value="%{user.fixedTelephone}"></s:textfield>
							<s:hidden name="student.studentNum" value="%{user.studentNum}"></s:hidden>
						</s:if>
						<s:else>
							<s:textfield label="职称" cssClass="userField"
								name="teacher.teachersTitles" id="tTitle" value="%{user.teachersTitles}"></s:textfield>
							<s:textfield label="研究方向" cssClass="userField"
								name="teacher.research" id="reaserch" value="%{user.research}"></s:textfield>
							<s:textfield label="手机" cssClass="userField"
								name="teacher.telephone" id="tTelephone" value="%{user.telephone}"></s:textfield>
							<s:textfield label="邮箱" cssClass="userField" name="teacher.email"
								id="tEmail" value="%{user.email}"></s:textfield>
							<s:textfield label="固定电话" cssClass="userField"
								name="teacher.fixedTelephone" id="tFixed" value="%{user.fixedTelephone}"></s:textfield>
							<s:hidden name="teacher.teacherNum" value="%{user.teacherNum}"></s:hidden>
						</s:else>
					</s:form>
				</div>
				<div>
					<s:a href="%{modifyI}" cssClass="userSubmit" theme="ajax"
						formId="inforForm" targets="inforTip" loadingText="修改中...">修改</s:a>
				</div>
				<div id="inforTip" class="tip">
				</div>
			</div>
		</div>

		<div id="mask" style="display: none"></div>
	</body>
</html>
